import request from '@/utils/request'

export function add(data) {
  return request({
    url: '/product/spuinfo',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/product/spuinfo/' + id,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: '/product/spuinfo',
    method: 'put',
    data
  })
}

export function editStatus(data) {
  return request({
    url: '/product/spuinfo/status',
    method: 'put',
    data
  })
}

export function getSpuInfo(id) {
  return request({
    url: '/product/spuinfo/' + id,
    method: 'get'
  })
}

export function listSpuInfo(params) {
  return request({
    url: '/product/spuinfo/list/' + params.pageNum + '/' + params.pageSize,
    method: 'get',
    params
  })
}

export function spuUp(spuId) {
  return request({
    url: '/product/spuinfo/up/' + spuId,
    method: 'post'
  })
}

export default { add, edit, editStatus, del, getSpuInfo, listSpuInfo, spuUp }
